﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Reflection;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    // Description: Create new Bitmap from resource image
    /*
        Bitmap bitmap = Assembly.GetExecutingAssembly().LoadBitmapFromResource("Resources.Progress.gif");
     */

    public static partial class BitmapExtensions
    {
        public static Bitmap LoadBitmapFromResource(this Assembly assembly, string imageResourcePath)
        {
            var stream = assembly.GetManifestResourceStream(imageResourcePath);
            return stream != null ? new Bitmap(stream) : null;
        }
    }
}
